package com.springsecurity.utils;
import org.springframework.security.crypto.password.PasswordEncoder;
/**
 * @author cc
 * @date 2021/9/4 11:22
 * @Description 自定义加密算法
 */
public class MyPasswordEncoder implements PasswordEncoder {
    @Override
    public String encode(CharSequence charSequence) {
        String slat = "2105";
        String enpassword = MD5Util.MD5EncodeUtf8(MD5Util.MD5EncodeUtf8(charSequence+slat));
        return enpassword;
    }

    @Override
    public boolean matches(CharSequence charSequence, String s) {
        return encode(charSequence).equals(s);
    }
}
